import Vue from 'vue'
import Router from 'vue-router'
import Index from './views/Index.vue';
import Mall from './views/Mall.vue';
import ProductCategory from './views/ProductCategory.vue';
import ShoppingCart from './views/ShoppingCart.vue';
import Mine from './views/Mine.vue';

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
      {
          path: '/',
          component: Index,
          meta: {
                requireAuth: true,
          },
          children: [
              {
                  name: 'mall',
                  path: '/',
                  component: Mall,
                  meta: {
                        loginAuth: true,
                        title: '商城',
                        keepAlive: true,
                  },
              }, {
                  name: 'productCategory',
                  path: '/productCategory',
                  component: ProductCategory,
                  meta: {
                        loginAuth: true,
                        title: '分类',
                        keepAlive: true,
                  },
              }, {
                  name: 'shoppingCart',
                  path: '/shoppingCart',
                  component: ShoppingCart,
                  meta: {
                        loginAuth: true,
                        title: '购物车',
                        keepAlive: true,
                  },
              }, {
                  name: 'mine',
                  path: '/mine',
                  component: Mine,
                  meta: {
                        loginAuth: true,
                        title: '我的',
                        keepAlive: true,
                  },
              },
          ],
      },
      {
          path: '/product/list',
          name: 'productList',
          component: () => import(/* webpackChunkName: "productList" */ './views/ProductList.vue'),
          meta: {
              title: '商品列表',
          },
      },
      {
          path: '/product/detail',
          name: 'productDetail',
          component: () => import(/* webpackChunkName: "productDetail" */ './views/ProductDetail.vue'),
          meta: {
              title: '商品详情',
          },
      },
      {
          path: '/product/category',
          name: 'productCategory',
          component: () => import(/* webpackChunkName: "productCategory" */ './views/ProductCategory.vue'),
          meta: {
              title: '商品分类',
          },
      },
      {
          path: '/product/comment',
          name: 'productComment',
          component: () => import(/* webpackChunkName: "productComment" */ './views/ProductComment.vue'),
          meta: {
              title: '商品评价',
          },
      },
      {
          path: '/loginRegister',
          name: 'loginRegister',
          component: () => import(/* webpackChunkName: "loginRegister" */ './views/LoginRegister.vue'),
          meta: {
              title: '登录注册',
              keepAlive: false,
          },
      },
      {
          name: 'orderConfirm',
          path: '/order/confirm',
          component: () => import(/* webpackChunkName: "orderConfirm" */ './views/OrderConfirm.vue'),
          meta: {
              loginAuth: true,
              title: '订单确认',
          },
      },
      {
          name: 'orderChannel',
          path: '/order/channel',
          component: () => import(/* webpackChunkName: "orderChannel" */ './views/OrderChannel.vue'),
          meta: {
              loginAuth: true,
              title: '选择支付方式',
          },
      },
      {
          name: 'orderList',
          path: '/order/list',
          component: () => import(/* webpackChunkName: "orderList" */ './views/OrderList.vue'),
          meta: {
              loginAuth: true,
              title: '订单列表',
              keepAlive: true,
          },
      },
      {
          name: 'orderDetail',
          path: '/order/detail',
          component: () => import(/* webpackChunkName: "orderDetail" */ './views/OrderDetail.vue'),
          meta: {
              loginAuth: true,
              title: '订单详情',
          },
      },
      {
          name: 'orderComment',
          path: '/order/comment',
          component: () => import(/* webpackChunkName: "orderComment" */ './views/OrderComment.vue'),
          meta: {
              loginAuth: true,
              title: '发表评论',
          },
      },
      {
          name: 'addressList',
          path: '/address/list',
          component: () => import(/* webpackChunkName: "addressList" */ './views/AddressList.vue'),
          meta: {
              loginAuth: true,
              title: '收货地址',
              keepAlive: true,
          },
      },
      {
          name: 'addressEdit',
          path: '/address/edit',
          component: () => import(/* webpackChunkName: "addressEdit" */ './views/AddressEdit.vue'),
          meta: {
              loginAuth: true,
              title: '编辑收货地址',
          },
      },
      {
          name: 'logisticsDetail',
          path: '/order/logistics',
          component: () => import(/* webpackChunkName: "logisticsDetail" */ './views/LogisticsDetail.vue'),
          meta: {
              loginAuth: true,
              title: '物流详情',
          },
      },
      {
          name: 'shoppingCart',
          path: '/shoppingCart',
          component: () => import(/* webpackChunkName: "shoppingCart" */ './views/ShoppingCart.vue'),
          meta: {
              loginAuth: true,
              title: '购物车',
          },
      },
      {
          name: 'mineShare',
          path: '/mine/share',
          component: () => import(/* webpackChunkName: "mineShare" */ './views/MineShare.vue'),
          meta: {
              loginAuth: true,
              title: '我的分享',
              keepAlive: true,
          },
      },
      {
          name: 'physicalStores',
          path: 'store/list',
          component: () => import(/* webpackChunkName: "physicalStores" */ './views/PhysicalStores.vue'),
          meta: {
              loginAuth: true,
              title: '线下门店',
              keepAlive: true,
          },
      },
      {
          name: 'mineIncome',
          path: '/mine/income',
          component: () => import(/* webpackChunkName: "mineIncome" */ './views/MineIncome.vue'),
          meta: {
              loginAuth: true,
              title: '我的收益',
          },
      },
      {
          name: 'mineMoneyBill',
          path: '/mine/moneyBill',
          component: () => import(/* webpackChunkName: "mineMoneyBill" */ './views/MineMoneyBill.vue'),
          meta: {
              loginAuth: true,
              title: '现金积分明细',
          },
      },
      {
          name: 'mineShoppingBill',
          path: '/mine/mineShoppingBill',
          component: () => import(/* weminebpackChunkName: "mineShoppingBill" */ './views/MineShoppingBill.vue'),
          meta: {
              loginAuth: true,
              title: '购物积分明细',
          },
      },
      {
          name: 'mineMoneyWithdrawal',
          path: '/mine/moneyWithdrawal',
          component: () => import(/* webpackChunkName: "mineMoneyWithdrawal" */ './views/MineMoneyWithdrawal.vue'),
          meta: {
              loginAuth: true,
              title: '现金积分提现',
              keepAlive: true,
          },
      },
      {
          name: 'mineBankCard',
          path: '/mine/bankCard',
          component: () => import(/* webpackChunkName: "mineBankCard" */ './views/MineBankCard.vue'),
          meta: {
              loginAuth: true,
              title: '我的银行卡',
          },
      },
      {
          name: 'mineBankCardAdd',
          path: '/mine/bankCardAdd',
          component: () => import(/* webpackChunkName: "mineBankCardAdd" */ './views/MineBankCardAdd.vue'),
          meta: {
              loginAuth: true,
              title: '添加银行卡',
          },
      },
      {
          name: 'mineFans',
          path: '/mine/mineFans',
          component: () => import(/* webpackChunkName: "mineFans" */ './views/MineFans.vue'),
          meta: {
              loginAuth: true,
              title: '我的团队',
          },
      },
      {
          name: 'setting',
          path: '/setting',
          component: () => import(/* webpackChunkName: "setting" */ './views/Setting.vue'),
          meta: {
              loginAuth: true,
              title: '设置',
          },
      },
      {
          name: 'settingPassword',
          path: '/setting/password',
          component: () => import(/* webpackChunkName: "settingPassword" */ './views/SettingPassword.vue'),
          meta: {
              title: '修改密码',
              loginAuth: true,
          },
      },
      {
          name: 'mineData',
          path: '/mine/data',
          component: () => import(/* webpackChunkName: "mineData" */ './views/MineData.vue'),
          meta: {
              title: '个人资料',
              loginAuth: true,
          },
      },
      {
          name: 'mineAlbum',
          path: '/mine/album',
          component: () => import(/* webpackChunkName: "mineAlbum" */ './views/MineAlbum.vue'),
          meta: {
              loginAuth: true,
              title: '我的相册',
          },
      },
      {
          name: 'mineAlipay',
          path: '/mine/alipay',
          component: () => import(/* webpackChunkName: "mineAlipay" */ './views/MineAlipay.vue'),
          meta: {
              loginAuth: true,
              title: '支付宝信息',
          },
      },
      {
          name: 'mineWxpay',
          path: '/mine/wxpay',
          component: () => import(/* webpackChunkName: "mineWxpay" */ './views/MineWxpay.vue'),
          meta: {
              loginAuth: true,
              title: '微信信息',
          },
      },
      {
          name: 'mineMoneyTransferAccounts',
          path: '/mine/money/transferAccounts',
          component: () => import(/* webpackChunkName: "mineMoneyTransferAccounts" */ './views/MineMoneyTransferAccounts.vue'),
          meta: {
              loginAuth: true,
              title: '积分转账',
          },
      },
      {
          name: 'messageList',
          path: '/messageList',
          component: () => import(/* webpackChunkName: "messageList" */ './views/MessageList.vue'),
          meta: {
              loginAuth: true,
              title: '系统通知',
          },
      },
      {
          name: 'messageDetail',
          path: '/messageDetail',
          component: () => import(/* webpackChunkName: "messageDetail" */ './views/MessageDetail.vue'),
          meta: {
              loginAuth: true,
              title: '消息详情',
          },
      },
      {
          name: 'mineActivity',
          path: '/mine/activity',
          component: () => import(/* webpackChunkName: "mineActivity" */ './views/MineActivity.vue'),
          meta: {
              loginAuth: true,
              title: '专属活动',
          },
      },
      {
          name: 'about',
          path: '/about',
          component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
          meta: {
              title: '关于优汇聚福商城',
          },
      },
      {
          name: 'accountAndSecurity',
          path: '/accountAndSecurity',
          component: () => import(/* webpackChunkName: "accountAndSecurity" */ './views/AccountAndSecurity.vue'),
          meta: {
              title: '账号与安全',
              loginAuth: true,
          },
      },
      {
          name: 'onlineArticle',
          path: '/onlineArticle',
          component: () => import(/* webpackChunkName: "onlineArticle" */ './views/OnlineArticle.vue'),
          meta: {
              title: '相关文章',
          },
      },
      {
          name: 'forgetPassword',
          path: '/forgetPassword',
          component: () => import(/* webpackChunkName: "forgetPassword" */ './views/ForgetPassword.vue'),
          meta: {
              title: '忘记密码',
          },
      },
  ]
})
